﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="get_Listening.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Lesson.get_Listening" %>

<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <%
        int id = int.Parse(Request.QueryString["id"]);
        var get_listen = new TblLessonListenController().FetchAll().Where(x => x.ListenActive == true && x.LessonId==id);
    %>
    <ul class="w3-navbar w3-black">
        <div id="listen_name_area">
            <%
                foreach (TblLessonListen listen in get_listen)
                {
            %>
            <li class="Listen<%=listen.ListenId %>"><a class="listen_name w3-hide"><%=listen.ListenName %></a><a href="javascript:;" class="listenlink" ondblclick="editListen('<%=listen.ListenId %>')" onclick="openlisten(event, 'listen<%=listen.ListenId %>');"><%=listen.ListenName %>&nbsp;<i onclick="deletelisten(<%=listen.ListenId %>)" title="Xóa" class="fa fa-times w3-hover-white"></i></a></li>
            <%} %>
        </div>
        <li><a title="Thêm mới" href="javascript:;" onclick="addlisten();"><i class="fa fa-plus"></i></a></li>
    </ul>
    <%
        foreach(TblLessonListen listen in get_listen)
        {
         %>
    <div id="listen<%=listen.ListenId %>" class="hoithoai w3-padding w3-border listenpart" style="display: none">
        <div class="w3-hide listen_id"><%=listen.ListenId %></div>
        <textarea id="listen_content_<%=listen.ListenId %>" class="listen_content"><%=listen.ListenContent %></textarea>
        <ul class="w3-ul">
            <li>
                <div class="w3-row">
                    <a class="w3-text-red">Đáp án</a><br />
                    <div class="themvidu w3-threequarter">
                        <textarea id="listen_result_<%=listen.ListenId %>" class="listen_result"><%=listen.ListenResult %></textarea>
                    </div>
                </div>
            </li>
        </ul>
        <div class="w3-row w3-center w3-padding">
            <a class="w3-btn w3-purple btn_edit_listening"><i class="fa fa-save"></i>&nbsp;Lưu chỉnh sửa</a>
        </div>
    </div>
    <%} %>
</body>
</html>
